/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 2 -*- */
/**
* @file TestTimer.c
* 
* Function for testing the crono library code.
* 
* @author Miguel Ángel Vílchez López 2010 <sacra@openmatica.es>
*
* Codigo is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* 
* Codigo is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License along
* with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
 
#include <string.h>
#include <stdlib.h>
#include <timer.cpp>

/**
* @example TestTimer.c
*/

int main(int argc, char *argv[])
{

	if(argc<2)
	{
		puts("\nUSE:\nTestCrono <useconds>\n");
		puts("\t  e.g.");
		puts("\t    TestCrono 6000000 => Waits 6 seconds and print 'time passed'.\n");

		exit(EXIT_SUCCESS);
	}
	
	CMTimer temp(atol(argv[1]));
				
	while(1)
	{
		if(temp.check()==1)
			printf("Time passed\n");
	}

}
